package org.zhigong.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.zhigong.dao.ZhiweiDao;
import org.zhigong.entity.Zhiwei;
import org.zhigong.service.ZhiweiService;

import java.util.List;

/**
 * Created by Administrator on 2018/3/27 0027.
 */
@Service
public class ZhiweiServiceImpl implements ZhiweiService{

    @Autowired
    private ZhiweiDao zhiweiDao;

    public List<Zhiwei> getZhiweiList(Zhiwei zhiwei) {
        return zhiweiDao.selectByPage(zhiwei);
    }

    public List<Zhiwei> getZhiweiListAll() {
        return zhiweiDao.getAll();
    }

    public Zhiwei getZhiweiByZwbh(int zwbh) {
        return zhiweiDao.queryByBh(zwbh);
    }

    public Boolean addZhiwei(Zhiwei zhiwei) {
        int i = zhiweiDao.insertZhiwei(zhiwei);
        return i == 1;
    }

    public Boolean updateZhiwei(Zhiwei zhiwei) {
        int i = zhiweiDao.updateZhiwei(zhiwei);
        return i == 1;
    }

    public Boolean deleteZhiwei(int zwbh) {
        int i = zhiweiDao.deleteZhiwei(zwbh);
        return i == 1;
    }
}
